package com.eastfair.venueservice.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.common.dto.CommonServiceBookingDTO;
import com.eastfair.core.context.StaticContextUtil;
import com.eastfair.core.exception.BizException;
import com.eastfair.messagecenter.util.SendMsgUtil;
import com.eastfair.projectcore.enumeration.DataIsolationSystemSceneEnum;
import com.eastfair.projectcore.enumeration.MenuAffiliationEnum;
import com.eastfair.venueservice.dto.ServiceBookingDTO;
import com.eastfair.venueservice.dto.ServiceOrderDTO;
import com.eastfair.venueservice.entity.ExhibitionManage;
import com.eastfair.venueservice.entity.ServiceOrder;
import com.eastfair.venueservice.entity.WorkOrder;
import com.eastfair.venueservice.enumeration.*;
import com.eastfair.venueservice.exceptioncode.VenueServiceExceptionCode;
import com.eastfair.venueservice.service.*;
import com.eastfair.venueservice.vo.ServiceOrderVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

/**
 * 综合服务，主运 的订单服务.
 *
 * @author dqq
 * @date 2022 /11/10
 */
@Service
@Slf4j
public class VenueManageServiceOrderServiceImpl implements VenueManageServiceOrderService {

    @Value("${pay.payee.venue-manage}")
    private String venueManagePayee;

    @Resource
    private ServiceOrderService serviceOrderService;

    @Resource
    private ServiceBookingService serviceBookingService;

    @Resource
    private WorkOrderService workOrderService;

    @Resource
    private ServiceOrderOperateLogService serviceOrderOperateLogService;

    @Resource
    private VenueManageTransactionOrderService venueManageTransactionOrderService;

    @Resource
    private ExhibitionManageService exhibitionManageService;

    @Resource
    private SendMsgUtil sendMsgUtil;

    @Resource(name = "threadPoolTaskExecutor")
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;

    @Resource
    private TransactionTemplate transactionTemplate;

    @Override
    public Page<ServiceOrderVO> listServiceOrderVOs(PageParams<ServiceOrderDTO> pageParams) {
        return serviceOrderService.listServiceOrderVOs(pageParams);
    }

    @Override
    public ServiceOrderVO getVOByOrderNumber(String orderNumber) {
        return serviceOrderService.getVOByOrderNumber(orderNumber);
    }


    @Override
    @Transactional(rollbackFor = Exception.class)
    public ServiceOrder saveServiceOrderForVenue(ServiceOrderDTO serviceOrderDTO) {
        // 校验是否预定服务
        List<CommonServiceBookingDTO> commonServiceBookingList = serviceOrderDTO.getCommonServiceBookingList();
        if (commonServiceBookingList == null || commonServiceBookingList.isEmpty()) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_CAN_NOT_CREATE.getCode(), "无法生成订单，未预定服务");
        }
        // 主办特殊处理
        if (Objects.nonNull(serviceOrderDTO.getOrderSource()) && serviceOrderDTO.getOrderSource().eq(ServiceOrderOrderSourceEnum.SPONSOR_ORDER)) {
            serviceOrderDTO.setBelongSystem(MenuAffiliationEnum.P_COMPOSITE_VENUE.getCode());
            serviceOrderDTO.setPayStatus(ServiceOrderPayStatusEnum.SETTLE_AFTER_EXHIBITION);
        }
        // 计算订单金额，和每项服务的金额
        ServiceOrderService.calculateOrderAmount(serviceOrderDTO, commonServiceBookingList);
        // 保存订单
        ServiceOrder serviceOrder = serviceOrderService.saveServiceOrder(serviceOrderDTO);
        String orderNumber = serviceOrder.getOrderNumber();
        // 更新服务项的订单号
        List<ServiceBookingDTO> serviceBookingList = serviceOrderDTO.getServiceBookingList();
        for (ServiceBookingDTO serviceBookingDTO : serviceBookingList) {
            serviceBookingDTO.setOrderNumber(orderNumber);
            serviceBookingDTO.setDeclarationSystem(ExhibitionCompanyCompanyTypeEnum.getSceneEnum(serviceOrderDTO.getCompanyType()));
            serviceBookingDTO.setProviderSystem(DataIsolationSystemSceneEnum.P_COMPOSITE_VENUE.getCode());
        }
        // 批量保存服务预定
        serviceBookingService.addServiceBookingOfOrder(serviceBookingList);
        return serviceOrder;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public ServiceOrder updateServiceOrder(ServiceOrderDTO serviceOrderDTO) {
        return serviceOrderService.updateServiceOrder(serviceOrderDTO);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean submitServiceOrder(String orderNumber) {
        log.info("submitServiceOrder - 提交订单, orderNumber={}", orderNumber);
        serviceOrderService.submitServiceOrder(orderNumber);
        // 保存支付系统交易订单
        saveTransactionOrder(orderNumber);
        return true;
    }

    @Override
    public boolean saveTransactionOrder(String orderNumber) {
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST.getCode(), "订单不存在");
        }
        ServiceOrderDTO serviceOrderDTO = completeForTransactionOrder(serviceOrder);
        return serviceOrderService.saveTransactionOrder(serviceOrderDTO);
    }

    @Override
    public ServiceOrderDTO completeForTransactionOrder(ServiceOrder serviceOrder) {
        ServiceOrderDTO serviceOrderDTO = BeanUtil.toBean(serviceOrder, ServiceOrderDTO.class);
        serviceOrderDTO.setSystemCode(MenuAffiliationEnum.P_COMPOSITE_VENUE.getCode());
        serviceOrderDTO.setPayee(venueManagePayee);
        return serviceOrderDTO;
    }

    @Override
    public boolean cancelServiceOrder(String orderNumber) {
        log.info("cancelServiceOrder - 取消订单, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST.getCode(), "取消失败，订单不存在");
        }
        if (!ServiceOrderOrderStatusEnum.NOT_SUBMIT.eq(serviceOrder.getOrderStatus())
                && !ServiceOrderOrderStatusEnum.SUBMIT.eq(serviceOrder.getOrderStatus())) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_CAN_NOT_CANCEL.getCode(), "订单已派单，不可取消");
        }
        // 发起退款申请
        if (ServiceOrderPayStatusEnum.HAS_PAY.eq(serviceOrder.getPayStatus()) || ServiceOrderPayStatusEnum.PARTIAL_PAY.eq(serviceOrder.getPayStatus())) {
            ServiceOrderDTO refundServiceOrderDTO = BeanUtil.toBean(serviceOrder, ServiceOrderDTO.class);
            applyServiceOrderRefund(refundServiceOrderDTO);
            // 如果订单已经支付，支付系统订单先不能取消，要等退款结束之后再取消，取消支付系统交易订单
            // 发站内信
            ExhibitionManage exhibitionManage = exhibitionManageService.getById(serviceOrder.getExhibitionManageId());
            String content = String.format("有新的退款申请需要审核，单号：%s，展会名称：%s，申请人：%s", serviceOrder.getOrderNumber(), Objects.nonNull(exhibitionManage) ? exhibitionManage.getExhibitionName() : Strings.EMPTY, serviceOrder.getCompanyName());
            threadPoolTaskExecutor.execute(() -> {
                sendMsgUtil.sendInnerMsg(content, StaticContextUtil.getProjectSystemScene());
            });
        } else {
            // 取消支付系统订单
            venueManageTransactionOrderService.cancel(orderNumber);
        }
        updateOrderStatusCancel(orderNumber);
        return true;
    }

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    public boolean cancelTimeoutNotPayServiceOrder(String orderNumber) {
        return cancelServiceOrder(orderNumber);
    }

    @Override
    public ServiceOrder updateOrderStatusCancel(String orderNumber) {
        return transactionTemplate.execute(status -> {
            ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
            if (serviceOrder == null) {
                throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST.getCode(), "取消失败，订单不存在");
            }
            serviceOrder.setOrderStatus(ServiceOrderOrderStatusEnum.CANCEL);
            serviceOrderService.updateById(serviceOrder);
            // 将订单下服务修改为已取消
            ServiceBookingDTO serviceBookingDTO = new ServiceBookingDTO();
            serviceBookingDTO.setOrderNumber(serviceOrder.getOrderNumber());
            serviceBookingDTO.setOrderStatus(ServiceBookingOrderStatusEnum.CANCEL);
            serviceBookingService.updateBookingServiceOrderStatus(serviceOrder, serviceBookingDTO);
            // 处理库存
            ServiceOrderDTO serviceOrderDTO = new ServiceOrderDTO();
            serviceOrderDTO.setOrderNumber(orderNumber);
            serviceOrderDTO.setOrderStatus(ServiceOrderOrderStatusEnum.CANCEL);
            serviceBookingService.updateServiceInventory(serviceOrderDTO);
            // 记录操作日志
            serviceOrderOperateLogService.asyncLogCancelServiceOrder(serviceOrder);
            return serviceOrder;
        });
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateOrderStatusComplete(ServiceOrder serviceOrder) {
        log.info("updateOrderStatusComplete - 更新订单状态为已完成, serviceOrder={}", serviceOrder);
        // 查询订单下的所有工单
        List<WorkOrder> workOrderList = workOrderService.listByOrderNumber(serviceOrder.getOrderNumber());
        return updateOrderStatusComplete(serviceOrder, workOrderList);
    }

    @Override
    public boolean applyServiceOrderRefund(ServiceOrderDTO serviceOrderDTO) {
        serviceOrderDTO.setSystemCode(MenuAffiliationEnum.P_COMPOSITE_VENUE.getCode());
        return serviceOrderService.applyServiceOrderRefund(serviceOrderDTO);
    }

    @Override
    public boolean updateOrderStatusComplete(ServiceOrder serviceOrder, List<WorkOrder> workOrderList) {
        // 订单未支付完成，订单不能完成
        if (!ServiceOrderPayStatusEnum.HAS_PAY.eq(serviceOrder.getPayStatus())) {
            return false;
        }
        if (workOrderList == null || workOrderList.isEmpty()) {
            // 订单下没有工单
            return false;
        }
        // 检查是不是订单的所有工单都已完成
        boolean isAllComplete = true;
        for (WorkOrder workOrder : workOrderList) {
            if (!WorkOrderWorkOrderStatusEnum.FINISH.eq(workOrder.getWorkOrderStatus())
                    && !WorkOrderWorkOrderStatusEnum.CANCEL.eq(workOrder.getWorkOrderStatus())) {
                isAllComplete = false;
                break;
            }
        }
        // 订单支付完成，且工单都完成或者作废，则订单完成
        if (isAllComplete) {
            return serviceOrderService.updateOrderStatusComplete(serviceOrder);
        }
        return false;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusHasDispatch(String orderNumber) {
        log.info("updateOrderStatusDispatch - 更新订单状态为已派单, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST);
        }
        if (ServiceOrderOrderStatusEnum.CANCEL.eq(serviceOrder.getOrderStatus())) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_HAS_CANCEL.getCode(), "订单已取消，无法派单");
        }
        // 订单的服务可能分别派单，第一个服务派单时更新状态，其他服务再派单时不再更新状态
        if (ServiceOrderWorkOrderStatusEnum.HAS_DISPATCH.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.HAS_RECEIVE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.PARTIAL_COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        serviceOrder.setOrderStatus(ServiceOrderOrderStatusEnum.DISPATCH);
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.HAS_DISPATCH);
        serviceOrder.setDispatchWorkOrderTime(LocalDateTime.now());
        return serviceOrderService.updateById(serviceOrder);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusPartialDispatch(String orderNumber) {
        log.info("updateOrderStatusDispatch - 更新订单状态为已派单, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        serviceOrder.setOrderStatus(ServiceOrderOrderStatusEnum.DISPATCH);
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.PARTIAL_DISPATCH);
        serviceOrder.setDispatchWorkOrderTime(LocalDateTime.now());
        return serviceOrderService.updateById(serviceOrder);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusHasReceive(String orderNumber) {
        log.info("updateWorkOrderStatusHasReceive - 更新订单状态为已接单, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST);
        }
        if (ServiceOrderOrderStatusEnum.CANCEL.eq(serviceOrder.getOrderStatus())) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_HAS_CANCEL.getCode(), "订单已取消，无法接单");
        }
        if (ServiceOrderWorkOrderStatusEnum.HAS_RECEIVE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.PARTIAL_COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        serviceOrder.setOrderStatus(ServiceOrderOrderStatusEnum.RECEIVE);
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.HAS_RECEIVE);
        return serviceOrderService.updateById(serviceOrder);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusPartialComplete(String orderNumber) {
        log.info("updateWorkOrderStatusPartialComplete - 更新订单的工单状态为部分完成, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST);
        }
        return updateWorkOrderStatusPartialComplete(serviceOrder);
    }

    @Override
    public boolean updateWorkOrderStatusPartialComplete(ServiceOrder serviceOrder) {
        if (ServiceOrderOrderStatusEnum.CANCEL.eq(serviceOrder.getOrderStatus())) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_HAS_CANCEL.getCode(), "订单已取消，无法完成工单");
        }
        if (ServiceOrderWorkOrderStatusEnum.PARTIAL_COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (ServiceOrderWorkOrderStatusEnum.COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.PARTIAL_COMPLETE);
        return serviceOrderService.updateById(serviceOrder);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusComplete(String orderNumber) {
        log.info("updateWorkOrderStatusComplete - 更新订单的工单状态为已完成, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST);
        }
        // 查询订单下的所有工单
        List<WorkOrder> workOrderList = workOrderService.listByOrderNumber(serviceOrder.getOrderNumber());
        return updateWorkOrderStatusComplete(serviceOrder, workOrderList);
    }

    @Override
    public boolean updateWorkOrderStatusComplete(ServiceOrder serviceOrder, List<WorkOrder> workOrderList) {
        if (ServiceOrderOrderStatusEnum.CANCEL.eq(serviceOrder.getOrderStatus())) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_HAS_CANCEL.getCode(), "订单已取消，无法完成工单");
        }
        if (ServiceOrderWorkOrderStatusEnum.COMPLETE.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        if (workOrderList == null || workOrderList.isEmpty()) {
            // 订单下没有工单
            return false;
        }
        // 检查是不是订单的所有工单都已完成或作废
        boolean isAllCompleteOrCancel = true;
        for (WorkOrder workOrder : workOrderList) {
            if (!serviceOrder.getOrderNumber().equals(workOrder.getOrderNumber())
                    && !WorkOrderWorkOrderStatusEnum.FINISH.eq(workOrder.getWorkOrderStatus())
                    && !WorkOrderWorkOrderStatusEnum.CANCEL.eq(workOrder.getWorkOrderStatus())) {
                isAllCompleteOrCancel = false;
                break;
            }
        }
        // 工单不是都完成或作废，则订单派工状态为部分完成
        if (!isAllCompleteOrCancel) {
            return updateWorkOrderStatusPartialComplete(serviceOrder);
        }
        // 更新订单的工单状态为已完成
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.COMPLETE);
        serviceOrderService.updateById(serviceOrder);
        // 更新订单状态为已完成
        return updateOrderStatusComplete(serviceOrder, workOrderList);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatusCancel(String orderNumber) {
        log.info("updateWorkOrderStatusCancel - 更新订单的工单状态为已取消, orderNumber={}", orderNumber);
        ServiceOrder serviceOrder = serviceOrderService.getByOrderNumber(orderNumber);
        if (serviceOrder == null) {
            throw BizException.wrap(VenueServiceExceptionCode.ORDER_NOT_EXIST);
        }
        if (ServiceOrderWorkOrderStatusEnum.CANCEL.eq(serviceOrder.getWorkOrderStatus())) {
            return true;
        }
        // 查询订单下的所有工单
        List<WorkOrder> workOrderList = workOrderService.listByOrderNumber(serviceOrder.getOrderNumber());
        if (workOrderList == null || workOrderList.isEmpty()) {
            // 订单下没有工单
            return false;
        }
        // 检查是不是订单的所有工单都已作废
        boolean isAllCancel = true;
        for (WorkOrder workOrder : workOrderList) {
            if (!orderNumber.equals(workOrder.getOrderNumber())
                    && !WorkOrderWorkOrderStatusEnum.CANCEL.eq(workOrder.getWorkOrderStatus())) {
                isAllCancel = false;
                break;
            }
        }
        // 如果不是都作废，则尝试更新工单状态为已完成
        if (!isAllCancel) {
            return updateWorkOrderStatusComplete(serviceOrder, workOrderList);
        }
        // 更新订单的工单状态为已作废
        serviceOrder.setWorkOrderStatus(ServiceOrderWorkOrderStatusEnum.CANCEL);
        serviceOrderService.updateById(serviceOrder);
        // 更新订单状态为已完成
        return updateOrderStatusComplete(serviceOrder, workOrderList);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkOrderStatus(String orderNumber, ServiceOrderWorkOrderStatusEnum workOrderStatusEnum) {
        log.info("updateWorkOrderStatus - 更新订单的工单状态, orderNumber={} workOrderStatusEnum={}", orderNumber, workOrderStatusEnum);
        if (workOrderStatusEnum == null) {
            log.warn("updateWorkOrderStatus - 工单状态为空");
            return false;
        }
        if (ServiceOrderWorkOrderStatusEnum.HAS_DISPATCH.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusHasDispatch(orderNumber);
        }
        if (ServiceOrderWorkOrderStatusEnum.HAS_RECEIVE.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusHasReceive(orderNumber);
        }
        if (ServiceOrderWorkOrderStatusEnum.PARTIAL_COMPLETE.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusPartialComplete(orderNumber);
        }
        if (ServiceOrderWorkOrderStatusEnum.COMPLETE.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusComplete(orderNumber);
        }
        if (ServiceOrderWorkOrderStatusEnum.CANCEL.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusCancel(orderNumber);
        }
        if (ServiceOrderWorkOrderStatusEnum.PARTIAL_DISPATCH.eq(workOrderStatusEnum)) {
            return updateWorkOrderStatusPartialDispatch(orderNumber);
        }
        return true;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean payServiceOrder(ServiceOrderDTO serviceOrderDTO) {
        log.info("payServiceOrder - 支付订单, serviceOrderDTO={}", serviceOrderDTO);
        ServiceOrder serviceOrder = serviceOrderService.updatePayStatus(serviceOrderDTO);
        if (!ServiceOrderPayStatusEnum.HAS_PAY.eq(serviceOrder.getPayStatus())) {
            return true;
        }
        // 全部支付完成，更新库存
        serviceOrderDTO.setPayStatus(serviceOrder.getPayStatus());
        serviceBookingService.updateServiceInventory(serviceOrderDTO);
        // 如果订单支付完成，则尝试更新订单状态改为已完成
        return updateOrderStatusComplete(serviceOrder);
    }

    @Override
    public Boolean sendInnerMsg(ServiceOrderDTO serviceOrderDTO) {
        // 发站内信
        String content = String.format("有新的发票申请需要审核，单号：%s，展会名称：%s，申请人：%s", serviceOrderDTO.getOrderNumber(), serviceOrderDTO.getExhibitionManageName(), serviceOrderDTO.getCompanyName());
        threadPoolTaskExecutor.execute(() -> {
            sendMsgUtil.sendInnerMsg(content, StaticContextUtil.getProjectSystemScene());
        });
        return true;
    }

}